/*
 * Copyright (c) 2024 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "commonevent/commonevent_ordered_test.h"
#include "commonevent/commonevent_parameters_test.h"
#include "commonevent/commonevent_publish_test.h"
#include "commonevent/commonevent_publishinfo_test.h"
#include "napi/native_api.h"

EXTERN_C_START
static napi_value Init(napi_env env, napi_value exports) {
    napi_property_descriptor desc[] = {
        {"testCommonEventCreatePublishInfo001", nullptr,
         CesCapiTest::CommonEventPublishInfoTest::TestCommonEventCreatePublishInfo001, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventCreatePublishInfo002", nullptr,
         CesCapiTest::CommonEventPublishInfoTest::TestCommonEventCreatePublishInfo002, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventDestroyPublishInfo001", nullptr,
         CesCapiTest::CommonEventPublishInfoTest::TestCommonEventDestroyPublishInfo001, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetPublishInfoBundleName001", nullptr,
         CesCapiTest::CommonEventPublishInfoTest::TestCommonEventSetPublishInfoBundleName001, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetPublishInfoBundleName002", nullptr,
         CesCapiTest::CommonEventPublishInfoTest::TestCommonEventSetPublishInfoBundleName002, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetPublishInfoBundleName003", nullptr,
         CesCapiTest::CommonEventPublishInfoTest::TestCommonEventSetPublishInfoBundleName003, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetPublishInfoCode001", nullptr,
         CesCapiTest::CommonEventPublishInfoTest::TestCommonEventSetPublishInfoCode001, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetPublishInfoCode002", nullptr,
         CesCapiTest::CommonEventPublishInfoTest::TestCommonEventSetPublishInfoCode002, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetPublishInfoPermissions001", nullptr,
         CesCapiTest::CommonEventPublishInfoTest::TestCommonEventSetPublishInfoPermissions001, nullptr, nullptr,
         nullptr, napi_default, nullptr},
        {"testCommonEventSetPublishInfoPermissions002", nullptr,
         CesCapiTest::CommonEventPublishInfoTest::TestCommonEventSetPublishInfoPermissions002, nullptr, nullptr,
         nullptr, napi_default, nullptr},
        {"testCommonEventSetPublishInfoPermissions003", nullptr,
         CesCapiTest::CommonEventPublishInfoTest::TestCommonEventSetPublishInfoPermissions003, nullptr, nullptr,
         nullptr, napi_default, nullptr},
        {"getDataStr001", nullptr, CesCapiTest::CommonEventPublishInfoTest::GetDataStr001, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"getDataStr002", nullptr, CesCapiTest::CommonEventPublishInfoTest::GetDataStr002, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"getDataStr003", nullptr, CesCapiTest::CommonEventPublishInfoTest::GetDataStr003, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetPublishInfoData001", nullptr,
         CesCapiTest::CommonEventPublishInfoTest::TestCommonEventSetPublishInfoData001, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetPublishInfoData002", nullptr,
         CesCapiTest::CommonEventPublishInfoTest::TestCommonEventSetPublishInfoData002, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetPublishInfoData003", nullptr,
         CesCapiTest::CommonEventPublishInfoTest::TestCommonEventSetPublishInfoData003, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetPublishInfoData004", nullptr,
         CesCapiTest::CommonEventPublishInfoTest::TestCommonEventSetPublishInfoData004, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetPublishInfoData005", nullptr,
         CesCapiTest::CommonEventPublishInfoTest::TestCommonEventSetPublishInfoData005, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetPublishInfoData006", nullptr,
         CesCapiTest::CommonEventPublishInfoTest::TestCommonEventSetPublishInfoData006, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetPublishInfoParameters001", nullptr,
         CesCapiTest::CommonEventPublishInfoTest::TestCommonEventSetPublishInfoParameters001, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetPublishInfoParameters002", nullptr,
         CesCapiTest::CommonEventPublishInfoTest::TestCommonEventSetPublishInfoParameters002, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetPublishInfoParameters003", nullptr,
         CesCapiTest::CommonEventPublishInfoTest::TestCommonEventSetPublishInfoParameters003, nullptr, nullptr, nullptr,
         napi_default, nullptr},

        {"testCommonEventPublish001", nullptr, CesCapiTest::CommonEventPublishTest::TestCommonEventPublish001, nullptr,
         nullptr, nullptr, napi_default, nullptr},
        {"testCommonEventPublish002", nullptr, CesCapiTest::CommonEventPublishTest::TestCommonEventPublish002, nullptr,
         nullptr, nullptr, napi_default, nullptr},
        {"testCommonEventPublish003", nullptr, CesCapiTest::CommonEventPublishTest::TestCommonEventPublish003, nullptr,
         nullptr, nullptr, napi_default, nullptr},
        {"testCommonEventPublishWithInfo001", nullptr,
         CesCapiTest::CommonEventPublishTest::TestCommonEventPublishWithInfo001, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventPublishWithInfo002", nullptr,
         CesCapiTest::CommonEventPublishTest::TestCommonEventPublishWithInfo002, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventPublishWithInfo003", nullptr,
         CesCapiTest::CommonEventPublishTest::TestCommonEventPublishWithInfo003, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventPublishWithInfo004", nullptr,
         CesCapiTest::CommonEventPublishTest::TestCommonEventPublishWithInfo004, nullptr, nullptr, nullptr,
         napi_default, nullptr},

        {"testCommonEventCreateParameters001", nullptr,
         CesCapiTest::CommonEventParametersTest::TestCommonEventCreateParameters001, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventDestroyParameters001", nullptr,
         CesCapiTest::CommonEventParametersTest::TestCommonEventDestroyParameters001, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetIntToParameters001", nullptr,
         CesCapiTest::CommonEventParametersTest::TestCommonEventSetIntToParameters001, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetIntToParameters002", nullptr,
         CesCapiTest::CommonEventParametersTest::TestCommonEventSetIntToParameters002, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetIntArrayToParameters001", nullptr,
         CesCapiTest::CommonEventParametersTest::TestCommonEventSetIntArrayToParameters001, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetIntArrayToParameters002", nullptr,
         CesCapiTest::CommonEventParametersTest::TestCommonEventSetIntArrayToParameters002, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetLongToParameters001", nullptr,
         CesCapiTest::CommonEventParametersTest::TestCommonEventSetLongToParameters001, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetLongToParameters002", nullptr,
         CesCapiTest::CommonEventParametersTest::TestCommonEventSetLongToParameters002, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetLongArrayToParameters001", nullptr,
         CesCapiTest::CommonEventParametersTest::TestCommonEventSetLongArrayToParameters001, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetLongArrayToParameters002", nullptr,
         CesCapiTest::CommonEventParametersTest::TestCommonEventSetLongArrayToParameters002, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetDoubleToParameters001", nullptr,
         CesCapiTest::CommonEventParametersTest::TestCommonEventSetDoubleToParameters001, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetDoubleToParameters002", nullptr,
         CesCapiTest::CommonEventParametersTest::TestCommonEventSetDoubleToParameters002, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetDoubleToParameters003", nullptr,
         CesCapiTest::CommonEventParametersTest::TestCommonEventSetDoubleToParameters003, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetDoubleToParameters004", nullptr,
         CesCapiTest::CommonEventParametersTest::TestCommonEventSetDoubleToParameters004, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetDoubleArrayToParameters001", nullptr,
         CesCapiTest::CommonEventParametersTest::TestCommonEventSetDoubleArrayToParameters001, nullptr, nullptr,
         nullptr, napi_default, nullptr},
        {"testCommonEventSetDoubleArrayToParameters002", nullptr,
         CesCapiTest::CommonEventParametersTest::TestCommonEventSetDoubleArrayToParameters002, nullptr, nullptr,
         nullptr, napi_default, nullptr},
        {"testCommonEventSetDoubleArrayToParameters003", nullptr,
         CesCapiTest::CommonEventParametersTest::TestCommonEventSetDoubleArrayToParameters003, nullptr, nullptr,
         nullptr, napi_default, nullptr},
        {"testCommonEventSetDoubleArrayToParameters004", nullptr,
         CesCapiTest::CommonEventParametersTest::TestCommonEventSetDoubleArrayToParameters004, nullptr, nullptr,
         nullptr, napi_default, nullptr},
        {"testCommonEventSetBoolToParameters001", nullptr,
         CesCapiTest::CommonEventParametersTest::TestCommonEventSetBoolToParameters001, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetBoolToParameters002", nullptr,
         CesCapiTest::CommonEventParametersTest::TestCommonEventSetBoolToParameters002, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetBoolToParameters003", nullptr,
         CesCapiTest::CommonEventParametersTest::TestCommonEventSetBoolToParameters003, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetBoolToParameters004", nullptr,
         CesCapiTest::CommonEventParametersTest::TestCommonEventSetBoolToParameters004, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetBoolArrayToParameters001", nullptr,
         CesCapiTest::CommonEventParametersTest::TestCommonEventSetBoolArrayToParameters001, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetBoolArrayToParameters002", nullptr,
         CesCapiTest::CommonEventParametersTest::TestCommonEventSetBoolArrayToParameters002, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetBoolArrayToParameters003", nullptr,
         CesCapiTest::CommonEventParametersTest::TestCommonEventSetBoolArrayToParameters003, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetBoolArrayToParameters004", nullptr,
         CesCapiTest::CommonEventParametersTest::TestCommonEventSetBoolArrayToParameters004, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetCharToParameters001", nullptr,
         CesCapiTest::CommonEventParametersTest::TestCommonEventSetCharToParameters001, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetCharToParameters002", nullptr,
         CesCapiTest::CommonEventParametersTest::TestCommonEventSetCharToParameters002, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetCharToParameters003", nullptr,
         CesCapiTest::CommonEventParametersTest::TestCommonEventSetCharToParameters003, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetCharToParameters004", nullptr,
         CesCapiTest::CommonEventParametersTest::TestCommonEventSetCharToParameters004, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetCharArrayToParameters001", nullptr,
         CesCapiTest::CommonEventParametersTest::TestCommonEventSetCharArrayToParameters001, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetCharArrayToParameters002", nullptr,
         CesCapiTest::CommonEventParametersTest::TestCommonEventSetCharArrayToParameters002, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetCharArrayToParameters003", nullptr,
         CesCapiTest::CommonEventParametersTest::TestCommonEventSetCharArrayToParameters003, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetCharArrayToParameters004", nullptr,
         CesCapiTest::CommonEventParametersTest::TestCommonEventSetCharArrayToParameters004, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventIsOrderedCommonEvent001", nullptr,
         CesCapiTest::CommonEventOrderedTest::TestCommonEventIsOrderedCommonEvent001, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventIsOrderedCommonEvent002", nullptr,
         CesCapiTest::CommonEventOrderedTest::TestCommonEventIsOrderedCommonEvent002, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"getIsOrdered001", nullptr, CesCapiTest::CommonEventOrderedTest::GetIsOrdered001, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventFinishCommonEvent001", nullptr,
         CesCapiTest::CommonEventOrderedTest::TestCommonEventFinishCommonEvent001, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventFinishCommonEvent002", nullptr,
         CesCapiTest::CommonEventOrderedTest::TestCommonEventFinishCommonEvent002, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"getIsAborted001", nullptr, CesCapiTest::CommonEventOrderedTest::GetIsAborted001, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"getIsFinished001", nullptr, CesCapiTest::CommonEventOrderedTest::GetIsFinished001, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"getIsGetAborted001", nullptr, CesCapiTest::CommonEventOrderedTest::GetIsGetAborted001, nullptr, nullptr,
         nullptr, napi_default, nullptr},
        {"getIsClearAborted001", nullptr, CesCapiTest::CommonEventOrderedTest::GetIsClearAborted001, nullptr, nullptr,
         nullptr, napi_default, nullptr},
        {"getCode001", nullptr, CesCapiTest::CommonEventOrderedTest::GetCode001, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"getData001", nullptr, CesCapiTest::CommonEventOrderedTest::GetData001, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"getData002", nullptr, CesCapiTest::CommonEventOrderedTest::GetData002, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventAbortCommonEvent001", nullptr,
         CesCapiTest::CommonEventOrderedTest::TestCommonEventAbortCommonEvent001, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventAbortCommonEvent002", nullptr,
         CesCapiTest::CommonEventOrderedTest::TestCommonEventAbortCommonEvent002, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventGetAbortCommonEvent001", nullptr,
         CesCapiTest::CommonEventOrderedTest::TestCommonEventGetAbortCommonEvent001, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventGetAbortCommonEvent002", nullptr,
         CesCapiTest::CommonEventOrderedTest::TestCommonEventGetAbortCommonEvent002, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventClearAbortCommonEvent001", nullptr,
         CesCapiTest::CommonEventOrderedTest::TestCommonEventClearAbortCommonEvent001, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventClearAbortCommonEvent002", nullptr,
         CesCapiTest::CommonEventOrderedTest::TestCommonEventClearAbortCommonEvent002, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetCodeToSubscriber001", nullptr,
         CesCapiTest::CommonEventOrderedTest::TestCommonEventSetCodeToSubscriber001, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetCodeToSubscriber002", nullptr,
         CesCapiTest::CommonEventOrderedTest::TestCommonEventSetCodeToSubscriber002, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetCodeToSubscriber003", nullptr,
         CesCapiTest::CommonEventOrderedTest::TestCommonEventSetCodeToSubscriber003, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventGetCodeFromSubscriber001", nullptr,
         CesCapiTest::CommonEventOrderedTest::TestCommonEventGetCodeFromSubscriber001, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventGetCodeFromSubscriber002", nullptr,
         CesCapiTest::CommonEventOrderedTest::TestCommonEventGetCodeFromSubscriber002, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetDataToSubscriber001", nullptr,
         CesCapiTest::CommonEventOrderedTest::TestCommonEventSetDataToSubscriber001, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetDataToSubscriber002", nullptr,
         CesCapiTest::CommonEventOrderedTest::TestCommonEventSetDataToSubscriber002, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventSetDataToSubscriber003", nullptr,
         CesCapiTest::CommonEventOrderedTest::TestCommonEventSetDataToSubscriber003, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventGetDataFromSubscriber001", nullptr,
         CesCapiTest::CommonEventOrderedTest::TestCommonEventGetDataFromSubscriber001, nullptr, nullptr, nullptr,
         napi_default, nullptr},
        {"testCommonEventGetDataFromSubscriber002", nullptr,
         CesCapiTest::CommonEventOrderedTest::TestCommonEventGetDataFromSubscriber002, nullptr, nullptr, nullptr,
         napi_default, nullptr},

    };
    napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc);
    return exports;
}
EXTERN_C_END

static napi_module demoModule = {
    .nm_version = 1,
    .nm_flags = 0,
    .nm_filename = nullptr,
    .nm_register_func = Init,
    .nm_modname = "subscribe",
    .nm_priv = ((void *)0),
    .reserved = {0},
};

extern "C" __attribute__((constructor)) void RegisterEntryModule(void) { napi_module_register(&demoModule); }
